class Solution {
public:
    string replaceSpaces(string &str) {
        string ret;
        for(auto x:str)
        if(x==' ')ret+="%20";
        else
        ret+=x;
        return ret;
    }
};
